<?php

/**
 *	Abstract class for model layer
 *	@author Renan Henrique Abreu <renanhabreu@gmail.com>
 *	@version 4.0
 *	@abstract
 *	@package Nucleo
 *	@subpackage Nucleo.Model
 *      @copyright 2009-2010 Renan Abreu
 */
abstract class Nucleo_Model_Model extends Nucleo_Model_Connection {



    public function __construct() {
        parent::getConnection();
    }
   
    /**
     * Will execute a sql query
     * @param string prepare sql
     * @param array items for sql
     * @return string result
     * @deprecated sice version 2.0.5
     */
    public function execute($sql,$arrayItens = null) {
        return self::exec($sql, $arrayItens);
    }

    /**
     * Will execute a sql query
     * @param string prepare sql
     * @param array items for sql
     * @return string result
     */
    static public function exec($sql,$arrayItens = null){
        try{
            $stm = self::$db->prepare($sql);
            $stm->execute($arrayItens);
        }catch (PDOException $e){
            echo 'DATABASE ERROR : '.$e->getMessage();
        }
        return $stm;
    }

}

?>
